Skip to content

feat(spec,plugin-report): report chart showEmptyGroups — show the declared options that have no records - #38284

Draft
objectstack-fleet[bot] wants to merge 15 commits into
mainfrom
claude/project-thread-19thpz
Draft

objectstack-fleet[bot] wants to merge 15 commits into
mainfrom
claude/project-thread-19thpz

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#3 · os-tesla · session_01L9qibyFBwGSJLARjP5asi3

Requested by Tesla · project thread

Fixes #36722
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — an optional, off-by-default presentation switch; the skill's report block teaches the chart's data keys (xAxis, yAxis, seriesBy), and the chart chrome beside it (showLegend, showDataLabels) is not taught there either

维护者速读

  • 报表图表多了一个开关「显示数量为 0 的分组」:打开后,选项字段(比如商机阶段)里没有记录的选项也画出来,计数和求和显示 0,平均值留空;不打开时和以前完全一样。
  • 解决的是「按阶段看商机」这类图里,空阶段直接消失、看起来像不存在的问题;按日期分组的图本来就会补齐空月份,不需要这个开关。
  • 只改图表的画法,不改查询和数据;有问题最多是图上多画或少画了空分组,关掉开关即可。
  • 无

What changes

  • packages/spec/src/ui/report.zod.ts: ReportChartSchema gains showEmptyGroups: z.boolean().optional(), no default. A report that does not set it parses exactly as before. The TSDoc and the .describe() state every case the switch adds nothing in: a field with no declared options, an order that reaches the chart, and an answer with no rows (it still draws no chart). They also say that a derived measure stays empty and that an option the report's own filter excludes reads as empty. Generated: the report reference page, the authorable surface (ui/ReportChart:showEmptyGroups) and the report liveness counts.
  • packages/spec/liveness/report.json: the key's own live row under chart.children (review nit N1), citing fillEmptyOptionGroups, DatasetReportChart and their tests, beside the seriesBy row.
  • ui/packages/plugin-report/src/emptyOptionGroups.ts (new): fillEmptyOptionGroups(rows, fill) adds one row for each declared option of the xAxis field that no answer row carries. An added row carries the stored value, so relabelling, declared order and option colours treat it like a real group. Its measure cells are emptyGroupValueFor(aggregate) from @objectstack/spec/data, the table the analytics executor fills its own empty groups with: 0 for count and sum, no value for avg/min/max. With seriesBy an added option gets one row per series value in the answer. Added rows are appended, so every index below the answer's length still addresses the answer. Whether an option is missing is judged by the stored value the answer's drillRawRows carries (index-aligned with the rows): a row whose raw twin states the x-axis value is matched by that value alone, so a label the server translated at the request locale never reads as a second, zero-valued group. Only a row with no raw twin falls back to spellings (stored value, authored label, localized label).
  • ui/packages/plugin-report/src/DatasetReportRenderer.tsx: the report chart calls the fill when chart.showEmptyGroups === true and no order reaches the chart's selection, before relabelling and the declared-order arrangement, and hands it state.drillRawRows. A mark on an added group opens no record list. This is plugin-report's first runtime import of @objectstack/spec, so the package moves it from devDependencies to dependencies (check:undeclared-dep-imports). The library build externalizes every bare specifier, so the bundle does not grow, and plugin-dashboard already depends on @objectstack/spec and imports @objectstack/spec/data at runtime. No ui/ import rule refuses it.
  • ui/packages/plugin-report/src/builder/: the report builder shows a "Show groups with no records" switch on every chart type the renderer draws as a series (planReportChart's 13 series types: bar, line and donut among the builder's own choices, and a stored funnel, pie or other series type). It saves chart.showEmptyGroups: true, turning it off removes the key, and an edit keeps it on every series type; only a single-value or tabular type drops it. One new locale key, report.builder.chart.showEmptyGroups, in all 11 packs.
  • Docs (claim amendment 1): an "embedded chart" paragraph in content/docs/ui/reports.mdx and a README note in plugin-report, both naming the no-fill cases.
  • Changesets: @objectstack/spec minor; @object-ui/plugin-report, @object-ui/i18n patch.

Not changed: the analytics executor and the dataset query (route B of the pre-claim report is not built), the table under the chart, HotCRM.

Why

A grouped dataset query answers one row per value that holds rows, so a select option no record carries is absent from the answer. A "deals by stage" bar chart then has no bar for an empty stage, and the stage reads as not existing rather than as zero. The issue's date half already holds on main: the executor fills every bucket of a report's period (#26893), so a date axis needs no switch.

Tests

  • emptyOptionGroups.test.ts (new, 10 cases): presence by the raw twin's stored value (a server label the client does not know is still present, with the no-raw-twin control drawing the false zero; a raw value overrules a display spelling another option carries; a row without a raw twin falls back to spellings); presence by value, label and localized label; count and sum at 0, avg with no value; one row per series value, the null series included; duplicate declarations added once; the input array returned when nothing is missing.
  • DatasetReportRenderer.test.tsx, a new top-level describe in the shared harness (9 cases): count fill in declared order at 0; a group the server labelled "Gewonnen" whose raw twin is closed_won is recognised, so no "Closed Won" at 0 is added; sum at 0 and avg empty; seriesBy at 0 in every series; a mark on an added stage opens no list and a real one still drills; the selection sent is identical with the switch on and off; CONTROLS that add nothing: switch off, a measure order, a text field with no declared options.
  • DatasetReportRenderer.dateRange-25873.test.tsx, a new describe: a date axis over a period sends the same selection and draws the same buckets, the empty month included, with the switch on and off.
  • reportBuilder-36374.test.tsx, a new describe: the switch saves, parses as a valid report, reopens checked, and off removes the key; it is on for bar, line and donut and hidden on a number; the model keeps it across edits and drops it on metric and table; a stored funnel keeps it across a measure and a grouping edit and shows it, a stored gauge drops it; and over the whole ChartTypeSchema vocabulary the builder offers it on exactly the types planReportChart plans as a series.
  • packages/spec/src/ui/report.test.ts: absent stays absent, and a non-boolean is refused at showEmptyGroups.

Acceptance notes

  • Deviation from the claim's no-fill list. The claim said "not when truncated, sorted by a measure". (1) The chart's selection never sends limit or offset, and the dataset answer carries no truncation signal, so a truncated chart answer does not occur on this path; there is nothing to test. (2) The fill declines under ANY order that reaches the chart, a dimension order included, not only a measure order. Appended rows have no place in an authored order, and the declared-option arrangement is already off under an order. This narrows when the switch acts; it refuses nothing.
  • A report whose answer has zero rows still draws no chart, as before: the switch fills categories around an answer, it does not invent a chart from nothing. The TSDoc, the .describe(), the reports page and the README now say so.
  • The key is chart-only. The table rendered under the chart is not filled.

Verification

  • Two-minute check: pnpm --dir ui exec vitest run packages/plugin-report/src/__tests__/emptyOptionGroups.test.ts packages/plugin-report/src/__tests__/DatasetReportRenderer.test.tsx passes, the new blocks included.
  • Read first: fillEmptyOptionGroups (emptyOptionGroups.ts), then the chartRows line in DatasetReportChart (DatasetReportRenderer.tsx).
Local readings at 1c290e5
  • Fill per aggregate (renderer, through the real chart props): count, an empty declared stage reads 0 at its declared place; sum reads 0; avg has no value at the added stage (nothing to average).
  • No-fill controls, each with the switch on: switch off adds nothing; a measure order adds nothing; a text field with no declared options adds nothing. The selection sent to the dataset is identical with the switch on and off.
  • Date-bucket pin: a date axis over a period, switch on and off, sends the same selection and draws the same buckets, the 0 month included.
  • Ablations through scripts/ablation-replace.mjs, each restore blob == HEAD: the fill condition forced false (at 6508986), 4 failed / 111 passed across the four touched suites, the four failures being the fill cases (count, sum/avg, seriesBy, drill), with the controls and the date pin green; the raw-twin branch disabled (at 0d03b6f), 3 failed / 104 passed, the three stored-value pins; the builder's switch set put back to bar/line/donut, 2 failed / 105 passed, the stored-funnel pin and the planReportChart parity pin.
  • Suites at 1c290e5: emptyOptionGroups, DatasetReportRenderer, reportBuilder-36374 107 passed, DatasetReportRenderer.dateRange-25873 and report-spec-parity green (5 files, 134 passed at 0d03b6f); at 86c2dbe the four touched files 115 passed and pnpm --dir ui exec vitest run packages/plugin-report packages/i18n 149 files, 2292 passed, 20 skipped. packages/spec src/ui/report.test.ts 83 passed.
  • Typecheck: @object-ui/plugin-report type-check exit 0 at 1c290e5, after building its dependencies' declarations. CI's Type Check UI was red at a9c6b54 on one new test line (TS2339, chart?.type read off {}), reproduced locally and fixed in 1c290e5.
  • Browser at 86c2dbe (showcase, objectstack dev --fresh plus the console on vite, Playwright): on the local fresh database the two Backlog tasks were moved to To Do, so the status option Backlog holds no records. "Hours by Status (Chart)" drew To Do, In Progress, In Review, Done. In the report builder the "Show groups with no records" switch sits under "Show values". Switched on, the preview drew Backlog, To Do, In Progress, In Review, Done, with Backlog first (declared order) at no height. The switch is hidden on Number, and coming back to Bar it is off (the metric drops the key). Save sent PUT /api/v1/meta/report/showcase_hours_by_status_chart with chart.showEmptyGroups: true, then publish. The reloaded report view drew the five statuses, and the builder reopened with the switch on.
  • dispatch-gates --ran with recorded exit codes, swept at a9c6b54/1c290e5b: 126 derived, 125 run exit 0, 1 NOT MEASURED (exit 3: check-plugin-teardown-shape --self-test, fixture commit outside the shallow clone), 0 unrun. check:dts-closure and check:dual-build-cjs-loads first exited 1 on an incomplete local dist (no declarations for service-cluster, missing platform-objects files), packages this diff does not touch; both exit 0 after rebuilding those packages. The first sweep at 6508986 found one real red, check:undeclared-dep-imports (@objectstack/spec was a dev dependency), fixed in 86c2dbe.
  • PR CI at 1c290e5: 73 check-runs, 64 success, 9 skipped, 0 failure.
  • overlap-check.mjs VERDICT clean exit 0 at 1c290e5 against main and feat(service-knowledge): each source's sync state is one durable record, the same on every node #38307, fix(data-objectstack): uploadFile/uploadFiles upload through the storage service presigned flow #38237, feat(console): a new chat conversation is about the record on the page until its first send, shown as a chip in the composer #38230, chore: version packages (next) #38192, feat(spec)!: retire FormView modalSize — no form view opens in a dialog #38168 (all merge cleanly).

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3

…ness counts for showEmptyGroups

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
…er chart.showEmptyGroups

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
… the date-axis no-op

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
…in-report README

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
The chart reads emptyGroupValueFor from @objectstack/spec/data at runtime,
so the package moves from devDependencies to dependencies.

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️ 3 changed file(s) yielded no anchor (packages/spec/authorable-surface/ui.json, packages/spec/liveness/report.json, packages/spec/liveness/state-counts/report.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/spec/authorable-surface/ui.json, packages/spec/liveness/report.json, packages/spec/liveness/state-counts/report.md) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 253 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 125 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 333e6f3f7324df63aaee756e588acedd90406775 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2073dcdd9fb5abca00126345ce6f610c63b567bb — the merge of head 2ac50c0e6f6f86da8574c22e00fa13fd1ff82648 into base 333e6f3f7324df63aaee756e588acedd90406775, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2073dcdd9fb5abca00126345ce6f610c63b567bb && git checkout 2073dcdd9fb5abca00126345ce6f610c63b567bb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 333e6f3f7324df63aaee756e588acedd90406775 2ac50c0e6f6f86da8574c22e00fa13fd1ff82648 && git checkout -B drift-repro 333e6f3f7324df63aaee756e588acedd90406775 && git merge --no-ff 2ac50c0e6f6f86da8574c22e00fa13fd1ff82648

node scripts/docs-audit/affected-docs.mjs --json 333e6f3f7324df63aaee756e588acedd90406775

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T11:48Z

Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 86c2dbe · 2026-11-28T11:48Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T12:01Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 86c2dbee2a7ccb27e5f721c243ddb4d42b621d7b
Local-runs: none
Scope: packages/spec/src/ui/report.zod.ts + ui/packages/plugin-report/src/emptyOptionGroups.ts, ui/packages/plugin-report/src/DatasetReportRenderer.tsx, ui/packages/plugin-report/src/builder/reportBuilderModel.ts, ui/packages/plugin-report/src/builder/ReportBuilder.tsx, packages/spec/authorable-surface/ui.json, packages/spec/liveness/state-counts/report.md, content/docs/references/ui/report.mdx; read only, never reviewed: packages/spec/src/data/aggregation-policy.ts, packages/spec/src/api/analytics.zod.ts, packages/spec/src/ui/chart.zod.ts, packages/spec/src/data/field.zod.ts, packages/spec/liveness/report.json, packages/spec/liveness/README.md, packages/services/service-analytics/src/dataset-executor.ts, packages/services/service-analytics/src/analytics-service.ts, packages/services/service-analytics/src/dimension-labels.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-analytics/src/structured-json-dimension-door.ts, ui/packages/core/src/utils/chart-series.ts, ui/packages/react/src/hooks/useDatasetDimensionLabels.ts, ui/packages/i18n/src/useObjectLabel.ts, ui/packages/plugin-report/vite.config.ts, ui/packages/plugin-report/package.json, ui/packages/plugin-dashboard/package.json, skills/objectstack-ui/rules/dashboards.md, .changeset/config.json, AGENTS.md

Inputs read: card #36722, its body and all five comments (triage, claim 7237658512, amendment 1 7237862534, os-dev-report 7238447636, amendment 2 7238456293); PR #38284, its body, both comments, the 30-file list (+677, -10) and the net diff from merge base e42520c6 (head is 9 commits ahead; main had moved 16 commits past it when read and touches, among this PR's paths, only the 11 locale packs); the 71 latest check-runs on the head: 62 success, 9 skipped, none red, none pending.

① Derived judgments

  • Accept set, right. ReportChartSchema is ChartConfigSchema.extend(...) over a closed (strictObject) shape, so before this head report.chart.showEmptyGroups was refused as an unknown key. It is now accepted as a boolean and refused at chart.showEmptyGroups for anything else. It is optional with no default, so the parsed output of every existing report is unchanged (absent stays absent). Nothing that parsed before is refused or reads differently: a widening.
  • Reach, right. The key is authorable at report.chart only. blocks[].chart is retired and a joined report refuses chart, so there is no second place it parses. It has one reader, DatasetReportChart.
  • Types and exports, right. ReportChart and ReportChartParsed gain one optional member. No export is added, so the api-surface baselines do not move, and none is in the diff.
  • Authorable surface, right. One row, ui/ReportChart:showEmptyGroups, in its sorted place between showDataLabels and showLegend.
  • Liveness counts, right, with a nit. report moves live 40 → 41 and classified 43 → 44, which is one new key resolved live. The key has no row of its own in liveness/report.json: it takes live from chart's declared childrenDefault. That is the gate's sanctioned inheritance and Spec property liveness is green, so the count is consistent. See N1.
  • Generated reference page, right as generated. content/docs/references/ui/report.mdx gains the row in both tables that print the chart shape (Report.chart, ReportChart), each carrying the .describe() text verbatim. The text itself is judged under S1.
  • Wire and query surface, unchanged, right. The fill runs after the fetch and is not part of the selection or its signature. The chart posts the same DatasetSelection with the switch on or off, and no executor, strategy or driver file is in the diff.
  • ui packages, right. @object-ui/plugin-report gains its first runtime import of @objectstack/spec (emptyGroupValueFor from @objectstack/spec/data) and lists the package under dependencies. @object-ui/i18n gains one key, report.builder.chart.showEmptyGroups, present in all 11 packs (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant), each beside showValues.
  • Skills-docs: none, true. The one skill that teaches a report chart is skills/objectstack-ui/rules/dashboards.md (Report Configuration). It teaches xAxis, yAxis and seriesBy and no chart chrome. showLegend and showDataLabels appear only in references/react-blocks.md, the ObjectChart block's prop table, not a report chart's. One thing to carry if a later card teaches the key: the skill's own example report has order: [{ by: 'amount_sum', ... }] over a chart whose yAxis is amount_sum, which is exactly the case where the switch adds nothing.
  • Gate verdicts. Check Changeset, Spec property liveness, Validate Package Dependencies, Type Check UI, TypeScript Type Check, all Test UI and Test Core shards, Build Docs, Check Documentation Links and Governed Surface Queue Guard are success on this head.

② Semver level

  • @objectstack/spec minor, right. A new authorable key is Metadata-protocol: added, which takes at least minor on the package the diff moves. Clause-②: yes (widening) is right for the reason in ①. Both lines are in the PR body and in both changeset bodies.
  • @object-ui/plugin-report and @object-ui/i18n patch, right. Both sit in the one fixed group with @objectstack/spec (.changeset/config.json), so they release at the group's level whatever their own line says, and patch is the level the earlier plugin-report feature changesets carry (36374, 36645).
  • The dependency move (amendment 2), justified and covered. The library build externalises every bare specifier (ui/packages/plugin-report/vite.config.ts, rollupOptions.external), so the published bundle resolves @objectstack/spec/data from the consumer's install at runtime. Left under devDependencies the package would import a module it does not declare. workspace:^ is the spelling plugin-dashboard uses for the same dependency. The ui changeset's last bullet states the move, and the lockfile hunk is that move and nothing else.
  • One inaccuracy in the account, not in the tree: plugin-dashboard's runtime imports are @objectstack/spec/ui and @objectstack/spec/shared. The /data subpath is imported at runtime by app-shell and the console app. It does not change the judgment.

③ Boundary flags

  • open_questions: empty in the report. Nothing to answer.
  • Deviation, truncation has no test: accepted. useDatasetRows posts dimensions, measures, runtimeFilter, totals, order, timeDimensions and compareTo, and never limit or offset. The executor windows rows only when the selection states one (applyWindow, and the limit/offset guards), and I found no default row cap on the dataset path. A truncated answer does not reach this chart today. Residual: nothing in the fill guards against a later change that adds a limit to the chart's selection.
  • Deviation, no fill under any order that reaches the chart: accepted as declared. It is narrower than the claim's "sorted by a measure" and the TSDoc says so. The reason holds for a client-side fill: the server sorts dimension keys by label over its own grid, and the renderer cannot place an appended row in that order. Worth recording that the executor's own date fill is wider here (timeBucketFillPlan declines only under a non-dimension order, since its ordering pass places the invented rows), so a report ordered by its own xAxis gets empty months but not empty options. That is a cost of route A, and it is stated in the contract.
  • Deviation, a zero-row answer draws no chart and the table is not filled: the behaviour is accepted, the contract text is not. See S1.
  • Deviation, manifest and lockfile surface (amendment 2): accepted, judged in ②.
  • Deviation, docs surface (amendment 1): accepted. ui/AGENTS.md asks for it.
  • Route A against the card's pointer. The card asked whether fillEmptyGroups is the right engine hook before a second zero-fill is written. It fills cells of rows that exist and by its own doc never invents a group, so it is not the hook for a missing option. The PR writes no second identity table: it reads emptyGroupValueFor, and it takes the aggregate from the answer's own fields[].aggregate, which the wire states on every dataset measure and its __compare twin and omits on a derived measure (analytics.zod.ts). So the renderer knows which aggregate produced the gap, which was the executor doc's objection to a consumer-side fill. Judged acceptable for a chart-only presentation key. Its costs are the two deviations above and S3.
  • SQL push-down: no finding. No new query, no id materialisation, no in-app join. The fill reads the option list the chart already loads through useDatasetDimensionMeta (an existing read) and adds at most options times series values rows in memory.
  • Prime Directive 2: the spec change is one schema member and its doc. No logic.
  • Multi-select axis: not reachable. A grouped dimension on a multi-value field is refused before any query (structured-json-dimension-door.ts, and the lint rule dimension-json-stored-field-refused), so the fill never meets a list-valued group key.
  • Security: none found.

④ Design judgment

packages/spec/src/ui/report.zod.ts, the TSDoc and .describe() against the renderer, sentence by sentence:

Sentence Served by Holds
adds every declared option of the xAxis field the answer left out fillEmptyOptionGroups, called from DatasetReportChart when chart.showEmptyGroups === true yes, except a zero-row answer (S1), and "left out" is judged by spelling (S3)
0 for count and sum emptyGroupValueFor(fields[].aggregate); count_distinct reads 0 too yes
empty for avg/min/max the same function answers undefined, and the added row then carries no measure cell, so the category is drawn with no mark yes. min and max take the avg branch; only avg has a test of its own
only a field that declares its options is filled resolveDimensionFieldMeta yields an entry only when the terminal field has options; without one the input array is returned yes
not filled when the report's order reaches the chart scopeOrder(order, queryDimensions, queryMeasures) non-empty skips the call yes
a date axis needs no switch a date field declares no options, so the fill is a no-op; the buckets are the executor's (fillEmptyTimeBuckets) yes
omitted = off strict === true yes

The remaining checks on the first consumer hold. A mark on an added group opens no list (added rows are appended, and the click handler returns for an index at or past state.rows.length), and real rows still drill with their own drillRawRows entry. Added rows carry the stored value, so relabelling, the declared order and option colours treat them as real groups. With seriesBy an added option gets one row per series value the answer holds, and the pivot draws the empty value in each. With a comparison the __compare cell is filled by the same aggregate, which is correct: the executor's compare merge already appends a row for any option that had records in the earlier window, so an option absent from the answer is empty in both. The schema file holds apart from S1.

S1 (should-fix) — the published contract lists two no-fill conditions and the renderer has a third: a zero-row answer. DatasetReportChart returns null at state.rows.length === 0 (DatasetReportRenderer.tsx, the "on error or empty" return) before the fill is reached. A report whose answer is empty, for example a period with no deals yet, draws no chart with the switch on, where the TSDoc reads "adds every DECLARED option ... that the answer left out" and content/docs/ui/reports.mdx reads "every declared option of the xAxis field appears". The same answer over a date axis with a period does draw, because the executor fills a known window from nothing. The PR body declares this as a deviation; the TSDoc, the .describe() and the docs page do not carry it. The .describe(), which is what the reference page and the JSON schema publish, also omits the order condition and names only "a field that declares its options". Fix on the prose faces: state both in the TSDoc and the .describe() (a zero-row answer still draws no chart; nothing is added when the report's order reaches the chart), regenerate report.mdx, and correct the reports.mdx sentence. Serving the zero-row case instead is the alternative, but the answer carries dimensionFields only when it has rows, so the prose fix is the practical one.

ui/packages/plugin-report/src/emptyOptionGroups.ts

S3 (should-fix) — "left out" is decided by matching spellings, where the answer carries the stored value. The fill builds present from the display rows and matches each option by its stored value, the label in the object document the client read, and the client bundle's label. The header says this covers "every spelling a row can carry". It does not. The server relabels a row at query time through translateSelectOptions at the request locale, including labels a picklist-bound field inherits under picklists.NAME.options.VALUE (dimension-labels.ts, plugin.ts). The client's label comes from a metadata read made at another time and kept in state across a language switch, and its bundle key is fieldOptions.OBJECT.FIELD.VALUE, with no picklist branch (useObjectLabel.ts). When the two disagree, the real group is not recognised and the chart draws a second, zero-valued category for an option that has records, which is the confident-zero class the card names. The mismatch is narrow, and the same weakness today costs only a label, an order or a colour; with the fill it costs a false zero. The exact test is already on the wire: drillRawRows is index-aligned with rows and holds the stored value of every field-backed, non-date dimension on any answer that has rows (analytics-service.ts), and the renderer already holds it as state.drillRawRows. Judge presence by that value where it is present and fall back to spellings only where it is not. The PR's own test fixture already supplies drillRawRows. This finding is from reading both sides, not from a run.

ui/packages/plugin-report/src/DatasetReportRenderer.tsx: the call site agrees with the contract apart from S1. The fill sits before relabelling and the declared-order arrangement, the order test is the same scopeOrder result the arrangement uses, and the drill guard is correct.

ui/packages/plugin-report/src/builder/reportBuilderModel.ts and ReportBuilder.tsx

S2 (should-fix) — the builder removes an authored chart.showEmptyGroups from every chart type outside bar, line and donut, on an unrelated edit. reconcile runs if (!SHOWS_EMPTY_GROUPS.has(chartType)) delete chart.showEmptyGroups and SHOWS_EMPTY_GROUPS is NEEDS_GROUPING, the three types the builder offers. pickMeasure and pickGrouping call it with selectedChartType(report), which is the stored type, and the builder opens any report. The renderer fills on all 13 series types (planReportChart: column, horizontal-bar, area, pie, funnel, treemap, radar, combo and the rest). So a funnel of deals by stage with the switch on, the case the feature is for, loses the key the first time someone picks another measure in the builder, with no switch shown to see it or put it back, although "Show values" is shown for that same chart. The changeset and the constant's comment say only a number or a table drops it. Fix: delete the key only for a type the renderer does not fill (the single-value and tabular plans), and add a case for a stored type outside the three. Showing the switch on every category-plotting type is the fuller fix. The same function drops seriesBy and annotations the same way on main; those lines are outside this diff and belong on a follow-up card.

Generated and baseline rows (authorable-surface/ui.json, liveness/state-counts/report.md, references/ui/report.mdx): consistent with the schema and with each other.

Nits, none of which moves correctness:

  • N1 (nit) — liveness/report.json has no showEmptyGroups row; the key is live by childrenDefault alone. seriesBy beside it carries a row "to carry the reader as evidence". A row citing ui/packages/plugin-report/src/emptyOptionGroups.ts#fillEmptyOptionGroups and its test would do the same here.
  • N2 (nit) — the TSDoc says an added group is "valued the way the analytics executor values any empty group". For a derived yAxis the answer states no aggregate, so the added group gets no value, where the executor would evaluate the derived op over filled zeros on a group that exists. Empty is the honest reading; the sentence could say a derived measure stays empty.
  • N3 (nit) — the builder offers the switch whatever the grouping is. On a date grouping, a text or lookup grouping, or a report whose order reaches the chart, it saves the key and nothing changes in the preview. The builder does not know a dimension's options, so this is a follow-up, not a fix here.
  • N4 (nit) — an option the report's own runtimeFilter excludes is drawn at 0 like any other empty option. True of the filtered set, but worth one sentence in the docs page. Likewise the key is accepted and ignored on a single-value or table chart type, as showLegend is.

No must-fix. S1, S2 and S3 are open on this head, and a delta review of their fix is owed.

Implemented-by: claude/project-thread-19thpz
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

The brief the contract reviewer above was handed, filled, for the seat to read before it adopts the record:

Contract review brief — PR #38284 @ 86c2dbee2a7ccb27e5f721c243ddb4d42b621d7b (card #36722)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/ui/report.zod.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #36722: its body and EVERY comment (rulings and earlier records included)
· PR #38284: its body, its file list, and the net diff against main at 86c2dbee2a7ccb27e5f721c243ddb4d42b621d7b
· the check-runs on 86c2dbee2a7ccb27e5f721c243ddb4d42b621d7b: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/ui/report.zod.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/166e2125-4268-552f-a555-2b7c43a99f0f/scratchpad/pr-38284/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T12:03Z

L1-a REWORK at 86c2dbee2a7ccb27e5f721c243ddb4d42b621d7b, for the three should-fix findings of the contract record.

  • Contract. The published-schema face is a new authorable key, chart.showEmptyGroups, in report.zod.ts. Record 7238949551 is a CONTRACT_REVIEW_TIER PASS: verify-review-tier passed and the record was posted with tier evidence. It has no must-fix, but S1, S2 and S3 are should-fix, so they are open on this head and the queue guard refuses the record until a delta closes them. The brief is 7238957997.
  • S1, the contract text. I confirm it. With the switch on, a zero-row answer still draws no chart, and an order that reaches the chart fills nothing. The TSDoc, the .describe() (which publishes as report.mdx and the JSON schema) and the reports.mdx sentence must say both. Today deviation (c) lives only in the PR body.
  • S2, the builder strips the key. I confirm it on the tree. In reportBuilderModel.ts ~196, reconcile deletes chart.showEmptyGroups whenever the stored type is not one of the three the builder offers. pickMeasure and pickGrouping pass the stored type. So a funnel by stage loses the key on any measure edit, while the renderer fills it on all 13 series types. Delete the key only for plans the renderer does not fill, and pin one case with a stored type outside the three.
  • S3, presence by spelling. "Left out" should be judged by the stored value (state.drillRawRows[i][xAxis], index-aligned and already on the wire), falling back to spellings only where that value is absent. Otherwise a server relabel at the request locale, or a picklist-inherited label, draws a false zero next to the real group.
  • Held. The claim and both amendments match the surface (30 files). The deviations hold: (a) no truncation on this path, (b) an order of any kind skips the fill, declared, and (c) as behaviour. The spec minor with Clause-②: yes (widening) / Metadata-protocol: added is right. The @objectstack/spec move to dependencies is justified, because the lib build externalises bare specifiers. All 11 locales carry the key. Skills-docs: none is true.
  • Nits N1–N4. They take the record's dispositions. N1 (no liveness/report.json evidence row) is worth taking in the same fix round, since that file moves anyway.
  • Next. The fix round can be a single commit. Then a delta goes to the same reviewer, covering S1–S3, plus my L1 delta. CI at this head: 62 success, 9 skipped, 0 failed.

…ue drillRawRows carries

A label the server translated at the request locale can differ from the one
the client holds, and a spelling miss drew a false zero beside the real
group. A row whose raw twin states the x-axis value is now matched by that
value alone; only a row with no raw twin falls back to spellings.

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
… series chart type

An unrelated edit dropped an authored switch from a stored funnel, pie or any
series type the builder does not offer. The switch now follows the
renderer's series plan: kept and shown on every type it fills, dropped only
on the single-value and tabular types.

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
…carries its liveness row

The TSDoc and describe now state that nothing is added when the report's
order reaches the chart and that an answer with no rows draws no chart, and
that a derived measure stays empty. The reference page is regenerated. The
key gets its own liveness row citing the reader and its tests.

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
…DME and changesets

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
…tcher the chart's type allows

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T13:11Z

Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 1c290e5 · 2026-11-28T13:11Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T13:17Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 1c290e5b070a546ca6766404948a08053beaa1c4
Local-runs: none
Scope: packages/spec/src/ui/report.zod.ts + ui/packages/plugin-report/src/emptyOptionGroups.ts, ui/packages/plugin-report/src/DatasetReportRenderer.tsx, ui/packages/plugin-report/src/builder/reportBuilderModel.ts, ui/packages/plugin-report/src/builder/ReportBuilder.tsx, packages/spec/liveness/report.json, packages/spec/liveness/state-counts/report.md, packages/spec/authorable-surface/ui.json, content/docs/references/ui/report.mdx; read only, never reviewed: ui/packages/plugin-charts/src/AdvancedChartImpl.tsx, ui/packages/core/src/utils/chart-series.ts, ui/packages/react/src/hooks/useDatasetDimensionLabels.ts, ui/packages/i18n/src/useObjectLabel.ts, packages/spec/src/data/aggregation-policy.ts, packages/spec/src/api/analytics.zod.ts, packages/spec/src/ui/chart.zod.ts, packages/spec/liveness/README.md, packages/services/service-analytics/src/analytics-service.ts, packages/services/service-analytics/src/dataset-executor.ts, packages/services/service-analytics/src/dimension-labels.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-analytics/src/structured-json-dimension-door.ts, ui/packages/plugin-report/vite.config.ts, ui/packages/plugin-report/package.json, skills/objectstack-ui/rules/dashboards.md, .changeset/config.json, AGENTS.md

DELTA review from 86c2dbee2a7ccb27e5f721c243ddb4d42b621d7b (record 7238949551: PASS, should-fix S1, S2 and S3, nits N1 to N4) to this head. The record stands on its own for this head: the whole PR was re-read at it, not only the five new commits.

Inputs read: card #36722, its body and all five comments (no new one since amendment 2); PR #38284, its body as it stands, its comments through the claim for this head (7239766892), the 31-file list (+788, -12), the net diff from merge base e42520c6 and the delta from the earlier head (5 commits, 13 files, head strictly ahead); the 73 latest check-runs on this head: 64 success, 9 skipped, none red, none pending.

① Derived judgments

  • Accept set, right and unchanged by the delta. report.chart.showEmptyGroups is a new optional boolean on a closed chart shape, with no default. It was refused as an unknown key before the PR, is accepted now, and a non-boolean is refused at chart.showEmptyGroups. Every existing report parses to what it parsed to before. The delta changes only the TSDoc and the .describe() text of the member, not its type.
  • Reach, right. Authorable at report.chart only; one reader, DatasetReportChart.
  • Types and exports, right. One optional member on ReportChart and ReportChartParsed. fillEmptyOptionGroups and its options type (now with rawRows) are internal to plugin-report: nothing outside DatasetReportRenderer.tsx imports the module, and the package index does not re-export it.
  • Authorable surface, right. One row, ui/ReportChart:showEmptyGroups, unchanged since the earlier head.
  • Liveness, right. The key now has its own live row under chart.children in liveness/report.json, beside seriesBy. Its four evidence paths exist at this head and name the symbols that read the key (emptyOptionGroups.ts#fillEmptyOptionGroups, DatasetReportRenderer.tsx#DatasetReportChart, and the two test files). The key was already counted live through childrenDefault, so the state counts (live 41, classified 44) do not move, and state-counts/report.md is rightly not in the delta. Spec property liveness is success. The note's last claim, that the builder offers the switch on every series chart type, is true of the code and is the subject of S4.
  • Generated reference page, right as generated. Both showEmptyGroups rows of references/ui/report.mdx carry the new .describe() text verbatim.
  • Wire and query surface, unchanged, right. The delta reads one more member of the answer the chart already holds (drillRawRows) and posts nothing new. No executor, strategy or driver file is in the PR.
  • Skills-docs: none, still true. The delta touches no skill, and the one skill that teaches a report chart teaches its data keys only.
  • Gate verdicts. Check Changeset, Spec property liveness, Validate Package Dependencies, Type Check UI, TypeScript Type Check, every Test UI and Test Core shard, Build Docs and Check Documentation Links are success on this head.

② Semver level

  • Levels and declarations hold. The delta leaves both changesets' front matter as it was: @objectstack/spec minor, @object-ui/plugin-report and @object-ui/i18n patch, the three in one fixed group. Clause-②: yes (widening) and Metadata-protocol: added stand in the PR body and in both changeset bodies, and both are right: the delta adds no key, export or accepted value, and narrows nothing.
  • The dependency move stands as judged before: the library build externalises bare specifiers, so @objectstack/spec belongs under dependencies, and the ui changeset says so.
  • The changeset bodies were reworded to match the fixes. One sentence there is stronger than the code: "a label the server translated differently is never drawn as a second, zero-valued group" holds only where the answer carries a raw twin; a row without one still falls back to spellings, as the module header says. Changeset prose is not reviewed here; it is noted for whoever next edits it for S4.

③ Boundary flags

  • open_questions: still empty. No new report was posted for this head; the PR body carries the readings.
  • Deviations, as before. Truncation cannot reach this chart (the selection sends no limit or offset): accepted. No fill under any order that reaches the chart: accepted, and now stated in the .describe() as well as the TSDoc. A zero-row answer draws no chart: accepted as behaviour, and now stated in the contract (S1 below). The manifest, lockfile and docs surfaces: accepted.
  • Surface. packages/spec/liveness/report.json is a 31st path. The claim's surface names report.zod.ts and the generated outputs it moves, and the ledger is not generated. The seat's own rework note asked for the row, so the path is wanted; recording it against the claim is the seat's to do.
  • Readings. The PR body's browser reading is still the one taken at the earlier head, on a bar chart. No reading at any head shows the switch on a pie, donut, funnel, treemap or sankey, which is where S4 lies.
  • SQL push-down: no finding. The delta adds no query, id materialisation or join. Presence is now read off drillRawRows, which the server already sends.
  • Prime Directive 2: the spec delta is doc text only.
  • Security: none found.

④ Design judgment

No must-fix. One should-fix, owing a delta review.

  • S1: closed. The TSDoc now says an answer with no rows still draws no chart, and the .describe() says that and the order condition. Both are true of DatasetReportChart: it returns before the fill when state.rows is empty, and skips the fill when scopeOrder leaves any key. references/ui/report.mdx carries the text, and reports.mdx now reads "every declared option ... that the answer left out".
  • S2: closed. reconcile deletes chart.showEmptyGroups only for a type outside SHOWS_EMPTY_GROUPS, which is now the 13 types planReportChart gives the series plan. A stored funnel keeps the key across pickMeasure and pickGrouping and shows the switch; a stored gauge drops it. A test walks ChartTypeSchema and holds the set equal to the series plan. The defect as raised, an authored key stripped by an unrelated edit, is gone. What the wider set now offers is S4.
  • S3: closed. fillEmptyOptionGroups takes the answer's drillRawRows as rawRows and, for each row whose raw twin carries the x-axis key, records the stored value alone; an option is present when its stored value is among those. Only a row with no raw twin, or one whose twin lacks the key, is matched by spellings. The call site passes state.drillRawRows whenever the answer has it, which is every answer with rows over a field-backed, non-date dimension (analytics-service.ts). A date axis has no raw twin and no options, so it stays a no-op. The module header now describes this truthfully. The server-translated case ("Gewonnen" over closed_won) is pinned at the helper, with its no-twin control, and at the renderer.

packages/spec/src/ui/report.zod.ts, the sentences the delta added, each against the code:

Sentence Served by Holds
a derived measure states no aggregate, so an added group carries no value for it fields[].aggregate is absent on a derived measure, and emptyGroupValueFor(undefined) answers no value yes
an answer with no rows at all still draws no chart the empty-answer return in DatasetReportChart, ahead of the fill yes
an option the report's own filter excludes reads as empty like any other the fill sees only the answer; a filtered-out option has no row yes
.describe(): nothing is added when the report's order reaches the chart, and an answer with no rows still draws no chart as above yes

The sentences carried over from the earlier head still hold as judged there: 0 for count, sum and count_distinct; no value for avg, min and max; only a field that declares options; a date axis untouched; omitted means off; the same selection posted either way; a mark on an added group opens no list.

S4 (should-fix) — on the chart types that size a mark by its value, an added group is not drawn, and the builder now offers the switch on them. SHOWS_EMPTY_GROUPS equals planReportChart's series plan exactly, and DatasetReportChart does hand the added rows to the chart on all 13 types. What the chart component then does with them differs by family (ui/packages/plugin-charts/src/AdvancedChartImpl.tsx, outside the diff, read):

Types What an added group becomes
bar, column, horizontal-bar, line, area, radar, combo a category on the axis at 0, or with no mark for avg, min and max. Drawn as the contract says
pie, donut no slice: by the arm's own note a row that is zero, null or absent "is drawn as nothing at all while staying in data". The chart then prints the unsized-rows footnote ("K of N rows have no KEY above zero ... not drawn to scale")
funnel the same footnote. With a count or sum the stage is a zero-width pinch. With avg, min, max or a derived measure the added row has no value, and the arm's own measured note says one such row beside a real one "drew ZERO segments", the real stage included
treemap not drawn at all: the arm's measured note is that 40 / 0 renders one full-bleed leaf, the same picture as a one-row treemap. The footnote is printed
sankey filtered out (value above zero only), and the omitted-rows note is printed
scatter its x axis is numeric, so a select axis is refused whole, with or without the fill

So on six of the 13 types the switch is kept, shown in the builder and described as drawing groups, and on treemap, sankey and scatter nothing is drawn for them; on pie, donut and funnel the only trace is a footnote that reads as a data warning, and on a funnel over an avg, min, max or derived measure the fill can cost the real stages. The TSDoc and .describe() say "show the declared options ... valued 0" with no bound on the chart type, the constant's comment says these are "the chart types that draw a category per group", and reports.mdx says the builder shows the switch "on every chart type that draws a category per group". None of the three is true of the value-sized types.

This was reachable at the earlier head too, through the schema on any of these types and through the builder's own donut. The earlier record did not read the chart component, and its S2 remedy pointed at the series plan. The delta followed that remedy and so widened the builder's offer from one such type to six. The reading above is from the chart's code and its own measured comments, not from a run, and no browser reading in the PR covers one of these types.

The fix is one predicate, shared by the renderer and the builder, for the types where an empty group has somewhere to be drawn:

  • the renderer adds rows only on those types, and at the least never hands a value-sized chart a row with no measure value;
  • the builder offers the switch only on those types. It should still keep an authored key on every series type, so S2 stays closed;
  • the TSDoc and .describe() name the families the switch acts on and say it adds nothing on the rest, with report.mdx regenerated, and the reports.mdx sentence, the constant's comment and the ledger note follow.

Keeping the fill on pie, donut and a count or sum funnel is a legitimate choice if the contract says what is and is not drawn there; treemap, sankey and scatter cannot be kept as they stand.

ui/packages/plugin-report/src/emptyOptionGroups.ts: agrees with the contract. Presence is exact wherever the answer states the stored value, added rows are still appended so drill indices hold, a duplicate declaration is added once, and the series handling is unchanged.

ui/packages/plugin-report/src/DatasetReportRenderer.tsx: the one-line delta passes the raw rows and nothing else moves. It agrees with the contract apart from S4, where the fill condition has no chart-type bound.

ui/packages/plugin-report/src/builder/reportBuilderModel.ts and ReportBuilder.tsx: hold for S2. The set and its comment carry S4.

packages/spec/liveness/report.json, state-counts/report.md, authorable-surface/ui.json, references/ui/report.mdx: consistent with the schema and with each other at this head.

Nits:

  • N1 (nit): closed, the ledger row is in.
  • N2 (nit): closed, the TSDoc states the derived-measure case.
  • N3 (nit) — stands as a follow-up, unchanged: the builder offers the switch on a date, text or lookup grouping and on a report whose order reaches the chart, where saving it changes nothing. No card for it is named on the PR or the issue.
  • N4 (nit): closed for the filter case, which the TSDoc and reports.mdx now state. Its second half, that the key is accepted and ignored on a single-value or table chart type, is still unstated and belongs in the same sentence S4 adds.

S1, S2 and S3 are closed on this head. S4 is open on it.

Implemented-by: claude/project-thread-19thpz
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T13:18Z

L1-a delta: REWORK at 1c290e5b070a546ca6766404948a08053beaa1c4 (#36722), from my REWORK 7238969094 at 86c2dbee.

Closed at this head. The contract-review delta record above (7239843832) is PASS and confirms it, and my own read agrees:

  • S1: the TSDoc, describe, report.mdx (regenerated) and reports.mdx state the order case and the zero-row case. The added sentences (a derived measure is left empty, a filter-excluded option reads empty) are true of DatasetReportChart.
  • S2: SHOWS_EMPTY_GROUPS is the 13 types planReportChart draws as a series, held there by a parity test across ChartTypeSchema. A stored funnel keeps the key, and a gauge drops it.
  • S3: fillEmptyOptionGroups takes rawRows: state.drillRawRows and judges presence by the stored value wherever a raw twin carries the x-axis key. Spellings are only the fallback. A raw twin whose x-axis is null is the null group and adds nothing, which is right.
  • The liveness row is right, and the changeset levels and declarations still hold.

Open, should-fix S4 (from the record; I spot-checked it in ui/packages/plugin-charts/src/AdvancedChartImpl.tsx). The renderer hands the added zero or empty rows to all 13 series types, and the builder now offers the switch on all of them. But only bar, column, horizontal-bar, line, area, radar and combo draw a category at 0:

  • pie, donut and funnel draw no slice or stage, and print the "no value above zero" footnote.
  • treemap and sankey drop the rows (the sankey keeps only cells above zero, ~1333).
  • scatter refuses a select axis.

So the constant's comment, the reports.mdx sentence ("every chart type that draws a category per group") and the ledger note are false there, and the TSDoc and describe put no bound on chart type.

Asked:

  1. Add one predicate, shared by the renderer and the builder, for the types where an empty group can be drawn.
  2. The renderer fills only there. At the least, it never hands a value-sized chart a row with no value.
  3. The builder OFFERS the switch only there, and still KEEPS an authored key on every series type, so S2 stays closed.
  4. The TSDoc and describe name the families, and say the key is accepted and ignored on single-value and table types (N4's other half). Regenerate report.mdx; reports.mdx, the constant's comment, the ledger note and the changesets follow.

Keeping pie, donut, and a count-or-sum funnel filled is acceptable if the contract says what is drawn there. Treemap, sankey and scatter cannot stay as they are.

While the changeset is open for S4: the ui changeset's "never" drawn as a second zero group holds only where the answer carries a raw row. Soften it.

Seat bookkeeping: packages/spec/liveness/report.json is a 31st path with no claim amendment on the card. N3 (the switch shown where it does nothing: date, text and lookup groupings, or under an order) stays a follow-up with no card yet.

This head is green (64 success, 0 failed, mergeable clean). Another L2 and L1 delta is owed on the S4 head.

…ts with a category axis

A chart that sizes its marks by value (pie, donut, funnel, treemap, sankey)
draws a zero group as nothing, and scatter takes no select axis, so one
shared predicate, chartDrawsEmptyGroups, now bounds the renderer's fill and
the builder's switch to bar, column, horizontal-bar, line, area, radar and
combo. The builder still keeps an authored key on every series type, and
shows no switch over a date axis. The TSDoc, describe, reference page,
reports page, README, ledger note and changesets name the families.

Claude-Session: https://claude.ai/code/session_01L9qibyFBwGSJLARjP5asi3
Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation protocol:ui size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

报表图表加「显示数量为 0 的分组」开关(#36645 第 2 项拆出)

2 participants